<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
  <PropertyGroup>
      <IncludeXHarnessCli>true</IncludeXHarnessCli>
      <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21566.2</MicrosoftDotNetXHarnessCLIVersion>
      <XharnessPath>%HELIX_CORRELATION_PAYLOAD%\microsoft.dotnet.xharness.cli\$(MicrosoftDotNetXHarnessCLIVersion)\tools\net6.0\any\Microsoft.DotNet.XHarness.CLI.dll</XharnessPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
    <Python>python3</Python>
    <HelixPreCommands>$(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk</HelixPreCommands>
  </PropertyGroup>

  <ItemGroup>
    <HelixCorrelationPayload Include="$(CorrelationPayloadDirectory)">
      <PayloadDirectory>%(Identity)</PayloadDirectory>
    </HelixCorrelationPayload>
  </ItemGroup>

  <PropertyGroup Condition="'$(AGENT_OS)' == 'Windows_NT'">
    <ScenarioDirectory>%HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\</ScenarioDirectory>
  </PropertyGroup>
  <PropertyGroup Condition="'$(AGENT_OS)' != 'Windows_NT'">
    <ScenarioDirectory>$HELIX_CORRELATION_PAYLOAD/performance/src/scenarios/</ScenarioDirectory>
  </PropertyGroup>

  <ItemGroup>
    <HelixWorkItem Include="SOD - Android HelloWorld APK Size">
        <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
        <PreCommands>cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --apk-name HelloAndroid.apk</PreCommands>
        <Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
        <PostCommands>$(Python) post.py</PostCommands>
    </HelixWorkItem>
    <HelixWorkItem Include="SOD - Android HelloWorld Extracted Size">
        <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
        <PreCommands>cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --unzip --apk-name HelloAndroid.apk</PreCommands>
        <Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
        <PostCommands>$(Python) post.py</PostCommands>
    </HelixWorkItem>
    <HelixWorkItem Include="SOD - Android Benchmarks.Droid APK Size">
        <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
        <PreCommands>cd $(ScenarioDirectory)bdnandroid;copy %HELIX_CORRELATION_PAYLOAD%\MonoBenchmarksDroid.apk .;$(Python) pre.py --apk-name MonoBenchmarksDroid.apk</PreCommands>
        <Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
        <PostCommands>$(Python) post.py</PostCommands>
    </HelixWorkItem>
    <HelixWorkItem Include="SOD - Android Benchmarks.Droid Extracted Size">
        <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
        <PreCommands>cd $(ScenarioDirectory)bdnandroid;copy %HELIX_CORRELATION_PAYLOAD%\MonoBenchmarksDroid.apk .;$(Python) pre.py --unzip --apk-name MonoBenchmarksDroid.apk</PreCommands>
        <Command>$(Python) test.py sod --scenario-name &quot;%(Identity)&quot;</Command>
        <PostCommands>$(Python) post.py</PostCommands>
    </HelixWorkItem>
    <HelixWorkItem Include="Mobile Benchmark - Android Benchmarks.Droid Benchmark Run">
        <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>
        <PreCommands>echo on;set XHARNESSPATH=$(XharnessPath);cd $(ScenarioDirectory)bdnandroid;copy %HELIX_CORRELATION_PAYLOAD%\MonoBenchmarksDroid.apk .;$(Python) pre.py --restart-device --apk-name MonoBenchmarksDroid.apk</PreCommands>
        <Command>$(Python) test.py androidinstrumentation --package-path .\pub\MonoBenchmarksDroid.apk --package-name com.microsoft.maui.benchmarks --instrumentation-name com.microsoft.maui.MainInstrumentation --scenario-name &quot;%(Identity)&quot;</Command>
        <PostCommands>$(Python) post.py</PostCommands>
        <Timeout>00:30:00</Timeout>
    </HelixWorkItem>
  </ItemGroup>
</Project>
